Ext.define('House.controller.House', {
	extend : 'Ext.app.Controller',
	config : {
		refs : {
			housedataview : '#houseList'// 房间列表
		},
		control : {
			housedataview : {
				itemtap : 'houelistitemtap' //列表单击
			}
		}
	},
	houelistitemtap : function(cmp, index, target, record) {
		var imgurl = record.get('url'),htypeStr,htype= record.get('htype'),hstate = record.get('state') == "0"? "未预定": "已预定";
		switch (htype) {	
			case 1:
				htypeStr = "普通房";
				break;
			case 2:
				htypeStr = "标准房";
			break;
			default:
				htypeStr = "商务房";
				break;
		}
		Ext.Msg.alert(
						"房间号:" + record.get('hno'),
						"<div style='width:240px'>房间大图：<img src='"
								+ imgurl
								+ "' height='150' width='150'/></div><div style='width:200px'>房间状态："
								+ hstate + "</div><div style='width:200px'>房间类型："+htypeStr+"</div>");
	}
});
